﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;


using vv = functionService.serfun_city7;
namespace enterData
{
    public partial class FormED2 : Form
    {
        Class_enterData ed;
        Button[] ab;
        ToolStripButton[] tsb;

        public FormED2() { InitializeComponent(); InitializeComponentMy(); }
        void InitializeComponentMy()
        {
            ed = new Class_enterData(); 
            ab = new Button[14];
            tsb = new ToolStripButton[7];

            tsb[0] = toolStripButton8;
            tsb[1] = toolStripButton6;
            tsb[2] = toolStripButton5;
            tsb[3] = toolStripButton2;
            tsb[4] = toolStripButton4;
            tsb[5] = toolStripButton1;
            tsb[6] = toolStripButton9;
            ed.loadFolderName(tsb);

            ab[0] = button1_step;
            ab[1] = button2;
            ab[2] = button3;
            ab[3] = button4;
            ab[4] = button5;
            ab[5] = button6;
            ab[6] = button7;
            ab[7] = button8;
            ab[8] = button9;
            ab[9] = button10;
            ab[10] = button11;
            ab[11] = button12;
            ab[12] = button13;
            ab[13] = button14_step;
            toolStripStatusLabel2.Text = 
               string.Concat
               ( 
                "ЗАКАЗ_", ed.q.tk(ETALON.param.zakaz_current_13).Substring(5,3), " ПМ_" , 
                 ed.q.selectScalar
                 (
                     string.Concat
                         ("SELECT name FROM listtable WHERE cod=",  
                           ed.q.tk(ETALON.param.zakaz_plase_current_15),";"
                         )
                 )
               );
            vv.kol = 1;
            ed.refrashlistView2Prod(listView1, listView2);
          //  ed.loadDocTd(listView1, listView2 );
        }










        #region events
        private void toolStripButton8_Click(object sender, EventArgs e)
        {
            ed.click_ToolStripButton_any(toolStripButton8, ab, toolStripDropDownButton1); //toolStripDropDownButton1.Visible = true;
        }

        private void toolStripButton6_Click(object sender, EventArgs e)
        {
            ed.click_ToolStripButton_any(toolStripButton6, ab, toolStripDropDownButton1);
        }

        private void toolStripButton5_Click(object sender, EventArgs e)
        {
            ed.click_ToolStripButton_any(toolStripButton5, ab, toolStripDropDownButton1);
        }

        private void toolStripButton2_Click(object sender, EventArgs e)
        {
            ed.click_ToolStripButton_any(toolStripButton2, ab, toolStripDropDownButton1);
        }

        private void toolStripButton4_Click(object sender, EventArgs e)
        {
            ed.click_ToolStripButton_any(toolStripButton4, ab, toolStripDropDownButton1);
        }

        private void toolStripButton1_Click(object sender, EventArgs e)
        {
            ed.click_ToolStripButton_any(toolStripButton1, ab, toolStripDropDownButton1);
        }

        private void toolStripButton9_Click(object sender, EventArgs e)
        {
            ed.click_ToolStripButton_any(toolStripButton9, ab, toolStripDropDownButton1);
        }

        private void toolStripButton7_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void toolStripDropDownButton1_Click(object sender, EventArgs e)
        {
            ed.changeMode(listView1, listView2, toolStripStatusLabel1, ab); 
        }
        #endregion

        private void toolStripButton3_Click(object sender, EventArgs e)
        {
            ed.moveUp(ab, listView1, listView2); this.Text = ed.readStek();
        }

        private void button1_step_Click(object sender, EventArgs e)
        {
            ed.click_Button_any(button1_step, ab, listView1, listView2); this.Text = ed.readStek();
        }

        private void button2_Click(object sender, EventArgs e)
        {
           
            ed.click_Button_any(button2, ab, listView1, listView2); this.Text = ed.readStek();
        }

        private void button3_Click(object sender, EventArgs e)
        {
            ed.click_Button_any(button3, ab, listView1, listView2); this.Text = ed.readStek();
        }

        private void button4_Click(object sender, EventArgs e)
        {
            ed.click_Button_any(button4, ab, listView1, listView2); this.Text = ed.readStek();
        }

        private void button5_Click(object sender, EventArgs e)
        {
            ed.click_Button_any(button5, ab, listView1, listView2); this.Text = ed.readStek();
        }

        private void button6_Click(object sender, EventArgs e)
        {
            ed.click_Button_any(button6, ab, listView1, listView2); this.Text = ed.readStek();
        }

        private void button7_Click(object sender, EventArgs e)
        {
            ed.click_Button_any(button7, ab, listView1, listView2); this.Text = ed.readStek();
        }

        private void button8_Click(object sender, EventArgs e)
        {
            ed.click_Button_any(button8, ab, listView1, listView2); this.Text = ed.readStek();
        }

        private void button9_Click(object sender, EventArgs e)
        {
            ed.click_Button_any(button9, ab, listView1, listView2); this.Text = ed.readStek();
        }

        private void button10_Click(object sender, EventArgs e)
        {
            ed.click_Button_any(button10, ab, listView1, listView2); this.Text = ed.readStek();
        }

        private void button11_Click(object sender, EventArgs e)
        {
            ed.click_Button_any(button11, ab, listView1, listView2); this.Text = ed.readStek();
        }

        private void button12_Click(object sender, EventArgs e)
        {
            ed.click_Button_any(button12, ab, listView1, listView2); this.Text = ed.readStek();
        }

        private void button13_Click(object sender, EventArgs e)
        {
            ed.click_Button_any(button13, ab, listView1, listView2); this.Text = ed.readStek();
        }

        private void button14_step_Click(object sender, EventArgs e)
        {
            ed.click_Button_any(button14_step, ab, listView1, listView2); this.Text = ed.readStek();
        }

        private void toolStripStatusLabel5_MouseDown(object sender, MouseEventArgs e)
        {
            toolStripStatusLabel5.ForeColor = Color.White;
        }

        private void toolStripStatusLabel6_MouseDown(object sender, MouseEventArgs e)
        {
            toolStripStatusLabel6.ForeColor = Color.White;
        }

        private void toolStripStatusLabel7_MouseDown(object sender, MouseEventArgs e)
        {
            toolStripStatusLabel7.ForeColor = Color.White;
        }

        private void toolStripStatusLabel8_MouseDown(object sender, MouseEventArgs e)
        {
            toolStripStatusLabel8.ForeColor = Color.White;
        }

        private void toolStripStatusLabel9_MouseDown(object sender, MouseEventArgs e)
        {
            toolStripStatusLabel9.ForeColor = Color.White;
        }

        private void toolStripStatusLabel10_MouseDown(object sender, MouseEventArgs e)
        {
            toolStripStatusLabel10.ForeColor = Color.White;
        }

        private void toolStripStatusLabel11_MouseDown(object sender, MouseEventArgs e)
        {
            toolStripStatusLabel11.ForeColor = Color.White;
        }

        private void toolStripStatusLabel13_MouseDown(object sender, MouseEventArgs e)
        {
            toolStripStatusLabel13.ForeColor = Color.White;
        }

        private void toolStripStatusLabel14_MouseDown(object sender, MouseEventArgs e)
        {
            toolStripStatusLabel14.ForeColor = Color.White;
        }

        private void toolStripStatusLabel12_Click(object sender, EventArgs e)
        {

        }

        private void toolStripStatusLabel5_MouseUp(object sender, MouseEventArgs e)
        {
            toolStripStatusLabel5.ForeColor = Color.Black; ed.putkol(1, toolStripStatusLabel4);//(1);
        }

        private void toolStripStatusLabel6_MouseUp(object sender, MouseEventArgs e)
        {
            toolStripStatusLabel6.ForeColor = Color.Black; ed.putkol(2, toolStripStatusLabel4);
        }

        private void toolStripStatusLabel7_MouseUp(object sender, MouseEventArgs e)
        {
            toolStripStatusLabel7.ForeColor = Color.Black; ed.putkol(3, toolStripStatusLabel4);
        }

        private void toolStripStatusLabel8_MouseUp(object sender, MouseEventArgs e)
        {
            toolStripStatusLabel8.ForeColor = Color.Black; ed.putkol(4, toolStripStatusLabel4);
        }

        private void toolStripStatusLabel9_MouseUp(object sender, MouseEventArgs e)
        {
            toolStripStatusLabel9.ForeColor = Color.Black; ed.putkol(5, toolStripStatusLabel4);
        }

        private void toolStripStatusLabel10_MouseUp(object sender, MouseEventArgs e)
        {
            toolStripStatusLabel10.ForeColor = Color.Black; ed.putkol(6, toolStripStatusLabel4);
        }

        private void toolStripStatusLabel11_MouseUp(object sender, MouseEventArgs e)
        {
            toolStripStatusLabel11.ForeColor = Color.Black; ed.putkol(7, toolStripStatusLabel4);
        }

        private void toolStripStatusLabel13_MouseUp(object sender, MouseEventArgs e)
        {
            toolStripStatusLabel12.ForeColor = Color.Black; ed.putkol(8, toolStripStatusLabel4);
        }

        private void toolStripStatusLabel14_MouseUp(object sender, MouseEventArgs e)
        {
            toolStripStatusLabel14.ForeColor = Color.Black; ed.putkol(9, toolStripStatusLabel4);
        }

        private void toolStripStatusLabel5_Click(object sender, EventArgs e)
        {

        }

        private void toolStripStatusLabel4_MouseDown(object sender, MouseEventArgs e)
        {

        }

        private void toolStripStatusLabel4_MouseUp(object sender, MouseEventArgs e)
        {
            ETALON.FormKolZakaz f = new ETALON.FormKolZakaz(); f.ShowDialog();
            if (f.IsSelect) { ed.putkol(Convert.ToInt32(f.valueEnter), toolStripStatusLabel4); }
        }

        private void toolStripStatusLabel12_MouseUp(object sender, MouseEventArgs e)
        {

        }
    }
}
